package com.cloudbroker.openapi.manage.controller;

import com.cloudbroker.bcs.common.util.VOUtil;
import com.cloudbroker.bcs.csvc.lightinvesting.api.t2service.LedSecT2Service;
import com.cloudbroker.bcs.csvc.lightinvesting.api.t2service.LedT2Service;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.transaction.back.HomeCombRecQryList;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.transaction.back.HomeComuserRecQryList;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.transaction.back.MiddleCombineBasicInfoList;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.transaction.vo.CombineMidBasicInfoform;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.transaction.vo.HomeCombRecForm;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.transaction.vo.HomeCuserRecForm;
import com.cloudbroker.bcs.platform.ltb.bizapi.t2service.transaction.CombineT2BizService;
import com.cloudbroker.bcs.platform.ltb.bizapi.t2service.transaction.IndiviDemandT2BizService;
import com.cloudbroker.bcs.platform.ltb.common.ext.annotation.SaveLog;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import static com.cloudbroker.bcs.platform.ltb.common.util.RequestUtil.getSingleParameterMapForBody;

/**
 * Created by fangyf18371 on 2016/12/5.
 * 中台组合--个性化需求封装接口调用入口
 */
@Controller
public class DemandController {
    @Resource
    private LedSecT2Service ledSecT2Service;
    @Resource
    private LedT2Service ledT2Service;
    @Resource
    private CombineT2BizService combineT2BizService;
    @Resource
    private IndiviDemandT2BizService indiviDemandT2BizService;


    /**
     * 首页组合推荐
     * @param request
     * @param jsonpcallback
     * @return
     */
    @ResponseBody
    @RequestMapping("/home_comb_rec")
    @SaveLog(remark = "组合推荐")
    public HomeCombRecQryList home_comb_rec(HttpServletRequest request, String jsonpcallback){
        HomeCombRecForm form = getSingleParameterMapForBody(request , HomeCombRecForm.class);
        return VOUtil.setJsonpResult(indiviDemandT2BizService.home_comb_rec(form), jsonpcallback);
    }

    /**
     * 首页达人推荐
     * @param request
     * @param jsonpcallback
     * @return
     */
    @ResponseBody
    @RequestMapping("/home_comuser_rec")
    @SaveLog(remark = "达人推荐")
    public HomeComuserRecQryList home_comuser_rec(HttpServletRequest request, String jsonpcallback){
        HomeCuserRecForm form = getSingleParameterMapForBody(request , HomeCuserRecForm.class);
        return VOUtil.setJsonpResult(indiviDemandT2BizService.home_comuser_rec(form), jsonpcallback);
    }

    /**
     * 中台组合基本信息
     * @param request
     * @param jsonpcallback
     * @return
     */
    @ResponseBody
    @RequestMapping("/middle_comb_details")
    @SaveLog(remark = "中台组合基本信息")
    public MiddleCombineBasicInfoList func_comb_details (HttpServletRequest request, String jsonpcallback){
            CombineMidBasicInfoform form = getSingleParameterMapForBody(request, CombineMidBasicInfoform.class);
            return VOUtil.setJsonpResult(combineT2BizService.combineBasicInfo(form), jsonpcallback);
    }

//    /**
//     * 中台达人签约申请查询
//     * @param request
//     * @param jsonpcallback
//     * @return
//     */
//    @ResponseBody
//    @RequestMapping("/talent_sign_apply_qry")
//    @SaveLog(remark = "中台达人签约申请查询")
//    public TalentSignApplyQryList talent_sign_apply_qry(HttpServletRequest request, String jsonpcallback){
//        TalentSignApplyQryForm form = getSingleParameterMapForBody(request, TalentSignApplyQryForm.class);
//        return VOUtil.setJsonpResult(indiviDemandT2BizService.talent_sign_apply_qry(form), jsonpcallback);
//    }

}
